import { request } from "@/utils/request.js"

//获取验证码      params参数
export const getCode=(params)=>request({
	url:"/client/user/code?phone="+params.phone+"&way="+params.way,
	method:"post"
})

//登录
export const LoginService=(data)=>request({
	url:"/client/user/login",
	data,
	method:"post"
})

//注册
export const RegisterService=(data)=>request({
	url:"/client/user/regist",
	method:"post",
	data
})


//修改密码
export const changePasswordService=(data)=>request({
	method:"post",
	data,
	url:"/client/user/findPassword" 
})

//上传坑洞信息
export const uploadHole=(data)=>request({
	method:'post',
	data,
	url:"/client/pothole/add"
})
//获得具体位置信息
export const getLocationDetail=(data)=>request({
	url:"/client/plat/getLocation?latitude="+data.latitude+"&"+"longitude="+data.longitude,
	 header: {
	    'token': uni.getStorageSync('token') // 从本地存储获取token
	  }
})


//获得天气数据
export const getWeatherData=(data)=>request({
	url:"/client/plat/getLocationWeather?latitude="+data.latitude+"&"+"longitude="+data.longitude,
	header: {
	   'token': uni.getStorageSync('token')
	 }
})

//获取每日赠言
export const getEverydayDedication=(id)=>request({
	url:`/client/dedication/get?id=${id}`,
	header: {
	   'token': uni.getStorageSync('token') 
	 }
})

//用户签到
export const  postSign=(id)=>request({
	url:"/client/user/sign/"+id,
	method:'POST',
	header: {
	   'token': uni.getStorageSync('token') 
	 }
})

//用户修改密码
export const updatePassword=(data)=>request({
	url:'/client/user/updatePassword',
	method:"PUT",
	data,
	header: {
	   'token': uni.getStorageSync('token') 
	 }
})

//获取本月签到情况
export const getMonthSign=(id)=>request({
	url:"/client/user/getAllSign/"+id,
	header: {
	   'token': uni.getStorageSync('token') 
	 }	
})

//获取本月总数

export const getMonthSum=()=>request({
	url:"/client/user/getAllSignCount",
	header: {
	   'token': uni.getStorageSync('token') 
	 }	
})